package com.r8game.security;

import com.alibaba.fastjson.JSONObject;

import io.dcloud.feature.uniapp.annotation.UniJSMethod;
import io.dcloud.feature.uniapp.bridge.UniJSCallback;
import io.dcloud.feature.uniapp.common.UniModule;


public class NativeModule extends UniModule {

    NativeLib nativeLib = new NativeLib();

    //run ui thread
    @UniJSMethod(uiThread = false)
    public void execute(JSONObject options, UniJSCallback callback) {
        String res = nativeLib.execute(options.toJSONString().getBytes());
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("res", res);
        callback.invoke(jsonObject);
    }


}
